<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="../build/react/umd/react.development.js"></script>
    <script src="../build/react-dom/umd/react-dom.development.js"></script>
    <script src="../build/babel/babel.min.js"></script>
</head>

<body>
    <div id="root"></div>
    <div id="root2"></div>
    <div id="root3"></div>
    <script type="text/babel">
        var users=["aa","bb","狗蛋"];
        var obj={a:1,b:2,c:3,d:4};
        var names = ['Alice', 'Emily', 'Kate'];

        ReactDOM.render(
            <ul>
                {
                    users.map((u,i)=>{
                        return <li key={i} >{u}</li>;
                    })
                }
            </ul>,
            document.getElementById("root"));

        ReactDOM.render(
            <ul>
                {
                    Object.keys(obj).map((k,i)=>{
                        return <li key={i} >key:{k},value:{obj[k]}</li>;
                    })
                }
            </ul>,
            document.getElementById("root2"));

        ReactDOM.render(
        <div>
        {
          names.map(function (name, index) {
            return <div key={index}>Hello, {name}!</div>
          })
        }
        </div>,
        document.getElementById('root3'));

    </script>
</body>

</html>